/* GUI CONVERTED from rcsoall.i (converter v1.75) Sat Aug 12 23:02:54 2000 */
/* rcsoall.i - Release Management Customer Schedules                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                   */
/*K1Q4*/ /*V8:WebEnabled=No                                             */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92           BY: WUG *F110*    */
/* REVISION: 8.6    LAST MODIFIED: 04/28/97           BY: TCC *K0CH*    */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb        */


     /* SCHEDULE ALLOCATION INCLUDE */


     find first soc_ctrl no-lock.

/*K0CH*  {gprun.i ""rcoqty.p""
.         "(input recid(sod_det), input today + all_days, output open_qty)"} */
/*K0CH*/ {gprun.i ""rcoqty.p""
      "(input recid(sod_det), input today + all_days, input sched_netting,
       output open_qty)"}
/*GUI*/ if global-beam-me-up then undo, leave.



        if open_qty > 0 and all_days <> 0 then do:
           sod_qty_all = max(open_qty - sod_qty_pick,0).
           if soc_all_avl and available in_mstr then do:
              if soc_all and not soc_on_ord then
                 sod_qty_all = min(sod_qty_all,
                                   max(in_qty_avail - in_qty_all,0)
                                   / sod_um_conv).
              else
              if soc_req and not soc_on_ord then
                 sod_qty_all = min(sod_qty_all,
                                   max(in_qty_avail - in_qty_req,0)
                                   / sod_um_conv).
              else
              if soc_all and soc_on_ord then
                 sod_qty_all = min(sod_qty_all,
                                  max(in_qty_avail - in_qty_all + in_qty_ord,0)
                                   / sod_um_conv).
              else
              if soc_req and soc_on_ord then
                 sod_qty_all = min(sod_qty_all,
                                  max(in_qty_avail - in_qty_req + in_qty_ord,0)
                                   / sod_um_conv).
           end.
        end.
